aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/thematique/[slug].tsx
Commit message (Collapse)AuthorAgeFilesLines
* refactor(components): replace PageLayout template with PageArmand Philippot2023-11-201-84/+57
| | | | | | | | | * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome`
* refactor(components): extract MetaItem from MetaListArmand Philippot2023-11-201-47/+45
| | | | | | * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers.
* refactor(hooks): remove useSettings hookArmand Philippot2023-11-151-5/+5
| | | | | | | It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks.
* refactor(components): replace LinksListWidget with LinksWidgetArmand Philippot2023-11-141-6/+6
| | | | | | | * avoid List component repeat * rewrite tests and CSS * add an id to LinksWidgetItemData (previously LinksListItems) type because the label could be duplicated
* refactor(components): rewrite PostsList componentArmand Philippot2023-11-131-5/+4
| | | | | | | | | | | | | | | * remove NoResults component and move logic to Search page * add a usePostsList hook * remove Pagination from PostsList (it is only used if javascript is disabled and not on every posts list) * replace `byYear` prop with `sortByYear` * replace `loadMore` prop with `onLoadMore` * remove `showLoadMoreBtn` (we can use `loadMore` prop instead to determine if we need to display the button) * replace `titleLevel` prop with `headingLvl` * add `firstNewResult` prop to handle focus on the new results when loading more article (we should not focus a useless span but the item directly)
* refactor(components): rewrite SearchForm componentArmand Philippot2023-11-111-1/+0
| | | | | | * remove searchPage prop (the consumer should handle the submit) * change onSubmit type * use `useForm` hook to handle the form
* feat(components): add a Time componentArmand Philippot2023-11-111-15/+3
| | | | | | Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task.
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-111-6/+58
| | | | | | It removes items complexity by allowing consumers to use any label/value association. Translations should also be defined by the consumer. Each item can now be configured separately (borders, layout...).
* refactor(components): merge HeadingButton and Widget componentsArmand Philippot2023-11-111-6/+12
| | | | | | The HeadingButton component was only used inside Widget component and it is not very useful on its own so I merge the two components in a new Collapsible component.
* refactor(routes): replace hardcoded routes with constantsArmand Philippot2023-10-241-19/+27
| | | | | | | | It makes it easier to change a route if needed and it avoid typo mistakes. I also refactored a bit the concerned files to be complient with the new ESlint config. However, I should rewrite the pages to reduce the number of statements.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-14/+12
| | | | | | Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements.
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-191-18/+18
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* chore: add a search form when posts list prints no resultsArmand Philippot2022-05-241-2/+3
|
* fix: ensure all topics/thematics have the base urlArmand Philippot2022-05-231-4/+5
|
* refactor(schema): use helpers function to avoid repeat between pagesArmand Philippot2022-05-231-39/+21
|
* refactor: reduce the number of data transformationArmand Philippot2022-05-231-25/+3
|
* chore: handle blog pagination when JS is disabledArmand Philippot2022-05-201-0/+1
|
* chore: add total articles on thematic pagesArmand Philippot2022-05-181-0/+1
|
* fix: convert undefined into null inside GetStaticPropsArmand Philippot2022-05-171-3/+4
| | | | Next.js was complaining because it cannot serialize undefined values.
* chore: use persistent layoutArmand Philippot2022-05-171-3/+12
| | | | | It prevents to rerender the common components between pages (header, footer...).
* refactor: use custom hook for breadcrumb items and schemaArmand Philippot2022-05-161-16/+6
|
* chore: add Thematic pageArmand Philippot2022-05-131-0/+247
|
* chore: remove old pages, components, helpers and typesArmand Philippot2022-04-291-214/+0
| | | | | Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch.
* refactor: use formatjs swc pluginArmand Philippot2022-03-231-0/+4
| | | | | I'm not able to configure SWC plugins in Next.js so to make it works, all translation must have an id.
* refactor: replace script tags with next/script (#10)Armand Philippot2022-02-211-4/+6
| | | | | | | | * refactor: replace script tags with next/script Since next.js v12.1.0 some warnings was displayed because I was using some script tags. * build(deps): bump next-themes to v0.1.1
* fix: make schema.org markup valid (#4)Armand Philippot2022-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 49c1b3b1556a0eb91c429a961fedd2bded8ffd47 Author: Armand Philippot <git@armandphilippot.com> Date: Wed Feb 16 15:17:52 2022 +0100 chore: add headline field to blogPosting schema commit 42214c6f032cc899ec252a9387be35dcad738546 Author: Armand Philippot <git@armandphilippot.com> Date: Wed Feb 16 15:09:11 2022 +0100 chore: update the searchAction markup and add query-input Google was complaining about "query-input" which is not in Schema.org representation. So I added it. commit 5f29226d937cbdcd262df2793f1588435d850f02 Author: Armand Philippot <git@armandphilippot.com> Date: Wed Feb 16 14:32:14 2022 +0100 chore: remove breadcrumb from homepage The breadcrumb is not displayed on the homepage, so the breadcrumb field should not appear inside Schema markup.
* chore: display initial posts, thematics & topicsArmand Philippot2022-02-141-1/+8
| | | | | By fetching the data in getStaticProps, I can display the data even for users with Javascript disabled.
* chore: improve accessibilityArmand Philippot2022-02-111-2/+14
|
* fix: handle getStaticPaths fallbackArmand Philippot2022-02-021-1/+6
| | | | | | | | I had errors with next build because of fallback. I need to return early if the path does not exists, if not Next complains about undefined variables. I don't think it was related but I also fix the paths format in getStaticPaths, I forgot the params object in some dynamic routes.
* refactor(config): move config from config dir to utilsArmand Philippot2022-01-291-13/+13
|
* chore: replace lingui functions with react-intlArmand Philippot2022-01-291-3/+17
|
* chore(i18n): replace i18n provider and helpersArmand Philippot2022-01-291-13/+13
|
* fix: handle translation with linguiArmand Philippot2022-01-281-5/+4
| | | | | | | | The previous method was not working so I tried a different approach. Translation is loaded but I'm still getting warnings: * Plurals for locale undefined aren't loaded * Text content did not match I can't figure how to fix them...
* chore: display total found posts in page metaArmand Philippot2022-01-251-0/+1
|
* refactor: rename all subject occurrences into topicArmand Philippot2022-01-231-11/+11
| | | | | I change the name in graphql endpoint, so I decided to repercute this change here.
* chore: add opengraph and twitter metaArmand Philippot2022-01-191-2/+7
|
* refactor(config): move defaultLocale as property of config.localesArmand Philippot2022-01-191-2/+2
| | | | | I will need the country code, so I think it makes more sense to gather them inside the same property.
* chore: add structured data using schema.org and JSON-LDArmand Philippot2022-01-191-0/+47
| | | | I also added the featured image on single article.
* chore: update sidebar and widgets stylesArmand Philippot2022-01-151-6/+6
| | | | | | | | | I'm now using a widget that can be expanded/collapsed. It also allows me to handle more effectively widgets overflow and to avoid styles repetitions. However, with stylelint rule "no-descending-specificity", I'm not sure if the stylesheets are really logical... Maybe I should deactivate this rule.
* chore: add title and meta desc to subjects and thematicsArmand Philippot2022-01-111-19/+28
|
* chore: add meta, toc and widgets on thematic pagesArmand Philippot2022-01-111-9/+41
|
* chore: adjust css grid on listing pages without sidebarArmand Philippot2022-01-071-10/+9
|
* chore: move Main grid to its childrenArmand Philippot2022-01-061-5/+8
| | | | This way I can use full width background for some blocks.
* refactor: reuse PostMeta components on single articles/pagesArmand Philippot2022-01-061-4/+2
|
* refactor: avoid mutated array with reverse methodArmand Philippot2022-01-041-1/+1
|
* chore: add a breadcrumb componentArmand Philippot2021-12-211-5/+4
|
* refactor: rewrite types and servicesArmand Philippot2021-12-201-5/+5
| | | | | | | I was repeating myself a lot in services. So I rewrited the different functions to improve readability and I extracted some formatting functions to put them in utils. I also rewrited/reorganized some types to keep consistent names.
* chore: create thematic page viewArmand Philippot2021-12-161-0/+77
For now I have to repeat some markup/styles, I cannot reuse PostsList component. WP GraphQL does not offer edges for ACF Post2Post or filters to get thematic posts with another way. I should create custom fields in backend to improve the posts fetching.